import request from '@/utils/request'

// export function updateArticleViewCount(id){
//     return request({
//         url:'article/updateViewCount/'+id,
//         method:'put',
//         headers:{
//             isToken:false
//         }
//
//     })
//
// }
export function updateArticleLikeCount(id){
    return request({
        url:'/article/updatelikeCount/'+id,
        method:'put',
        headers:{
            isToken:false
        }

    })

}
export function getArticleByPlantCategoryId(id){
    return request({
        url:'/article/getArticleByPlantCategoryId/'+id,
        method:'get',
        headers: {
            isToken: false
        },
    })
}

export function addArticle(param){
    return request({
        url: '/article/addArticle',
        method: 'post',
        headers: {
            isToken: false
        },
        data:param
    })
}
// 查询文章列表
export function articleList(query) {
    return request({
        url: '/article/articleList',
        method: 'get',
        headers: {
            isToken: false
        },
        params: query
    })
}
export function getLatestBaike() {
    return request({
        url: '/article/baike',
        method: 'get',
        headers: {
            isToken: false
        }
    })
}


//查询最热文章
export function hotArticleList() {//需要修改
    return request({
        url: '/article/browseList',
        headers: {
            isToken: false
        },
        method: 'get'
    })
}

//获取文章详情
export function getArticle(articleId) {
    return request({
        url: '/article/' + articleId,
        headers: {
            isToken: false
        },
        method: 'get'
    })
}

export function updateViewCount(articleId) {
    return request({
        url: '/article/updateViewCount/' + articleId,
        headers: {
            isToken: false
        },
        method: 'put'
    })

}
